// ID
// Level
// MaxLevel 3/5
// Combination 组合技能

// 枚举
export enum SkillID {
    NONE,
    FIRE_BALL,
    LIGHTNING,
    ICE,
    INVINCIBLE,
    ROLL,

}

// abstract 抽象类
export abstract class Skill {
    private _id: number = SkillID.NONE;
    private _combinationId: number = SkillID.NONE;
    private _level: number = 0;
    private _maxLevel: number = 0;

    get id() { return this._id; }
    get combinationId() { return this._combinationId; }
    get level() { return this._level; }
    get maxLevel() { return this._maxLevel; }
    get isMaxLevel() { return this._level >= this._maxLevel; }

    protected constructor(id:number,combinationId:number,level:number=0,maxLevel:number=4) {
        this._id = id;
        this._combinationId = combinationId;
        this._level = level;
        this._maxLevel = maxLevel;

    }

    public levelUp(): void {
        !this.isMaxLevel && this._level++;
    }

    // 抽象方法
    public abstract getName(): string;
    public abstract getDescription(): string;




}


export class SkillFireBall extends Skill {
    public constructor() {
        super(SkillID.FIRE_BALL, SkillID.NONE);
    }
    public getName(): string {
        return '技能-火球';
    }
    public getDescription(): string {
        return '发射火球点燃敌人';
    }
}


export class SkillLightning extends Skill {
    public constructor() {
        super(SkillID.LIGHTNING, SkillID.NONE);
    }
    public getName(): string {
        return '技能-雷击';
    }
    public getDescription(): string {
        return '对敌人造成雷击';
    }
}



export class SkillIce extends Skill {
    public constructor() {
        super(SkillID.ICE, SkillID.NONE);
    }
    public getName(): string {
        return '技能-冰冻';
    }
    public getDescription(): string {
        return '对敌人造成冰冻';
    }
}


// 无敌技能
export class SkillInvincelble extends Skill {
    public constructor() {
        super(SkillID.INVINCIBLE, SkillID.NONE);
    }
    public getName(): string {
        return '技能-无敌';
    }
    public getDescription(): string {
        return '无敌状态';
    }
}


export class SkillRoll extends Skill {
    public constructor() {
        super(SkillID.ROLL, SkillID.NONE);
    }
    public getName(): string {
        return '技能-滚动';
    }
    public getDescription(): string {
        return '滚动状态';
    }
}



